import http from "@/utils/http";
/**
 * 获取收货地址列表
 * @returns 
 */
export const getMemberAddress = () => {
    return http({
        url: '/member/address'
    })
}
/**
 * 添加收货地址
 * @param {*} data 新增的地址数据
 * @returns 
 */
export const postMemberAddress = (data) => {
    return http({
        url: '/member/address',
        method: 'post',
        data,
    })
}
/**
 * 删除指定收货地址
 * @param {Number} id 删除的数据id
 * @returns 
 */
export const deleteMemberAddress = (id) => {
    return http({
        url: `/member/address/${id}`,
        method: 'delete',
    })
}
/**
 * 查询收货地址详情
 * @param {Number} id 
 * @returns 
 */
export const getDetailMemberAddress = (id) => {
    return http({
        url: `/member/address/${id}`,
    })
}
/**
 * 更新收货地址
 * @param {object} data 需要更新的数据表单
 * @returns 
 */
export const putMemberAddress = (data) => {
    return http({
        url: `/member/address/${data.id}`,
        method: 'put',
        data,
    })
}